// -----------------------------------------------------------------------
//  <copyright file="AuthorizationCacheItem.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2024 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://www.dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2024-03-07 14:24</last-date>
// -----------------------------------------------------------------------

using DaprPlus.Filters;

namespace DaprPlus.Authorization;

public class ResourceAuthCacheItem
{
    public long RoleId { get; set; }

    public string[] Operations { get; set; } = [];

    /// <summary>
    /// 各操作的过滤条件组
    /// 第一层Key: 功能操作 (如 "GetPage", "Create")
    /// 第二层Key: 数据操作 (如 "Read", "Create", "Update", "Delete")
    /// </summary>
    public Dictionary<string, Dictionary<DataOperation, FilterGroup>> FilterGroups { get; set; } = [];
}
